﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace MainWebService
{
    public static class Logger
    {
        public static void LogText(string s)
        {
            try
            {
                string logTrail = DateTime.Now.Date.ToString("yyyyMMdd");
                string fname = Path.Combine(
                    "Logs", "logfile_" + logTrail + ".log");
                if (!Directory.Exists("Logs"))
                    Directory.CreateDirectory("Logs");

                if (!File.Exists(fname))
                    File.Create(fname);
                TextWriter tw = new StreamWriter(fname);
                tw.Write("Yada yada :" + s);
                tw.Close();
            }
            catch
            {
            }
        }
    }
}